function workkout() {
    goToGym();  //Workout in Gym B

    var goToGym = function() {
        console.log('Workout in Gym A');
    }

    return;

    function goToGym() {
        console.log('Workout in Gym B');
    }
}

workkout();

//上述代码js 解释器解释后是这样的
/*
function workkout() {
    ---函数声明移到scope的顶部
    function goToGym() {
        console.log('Workout in Gym B');
    }

    ---变量声明移到函数声明下面 但不赋值
    var goToGym;

    --- 其他在后面 顺序不变
    goToGym();  //Workout in Gym B

    goToGym = function() {
        console.log('Workout in Gym A');
    }

    return;
}
*/